home *** CD-ROM | disk | FTP | other *** search
/ A Teacher's Guide to the Holocaust / A Teacher's Guide to the Holocaust.iso / data / people / scripts / behcoursebuilder.js < prev    next >
Text File  |  1999-12-05  |  3KB  |  92 lines

  1. // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  2.  
  3. var MSG_notracking = "Tracking system not found";
  4. function MM_cmiCheckInstall(win) {
  5.   // Done since NS blows away window variables on resize
  6.   if (win==null) win = window;
  7.   if (win) {
  8.     if (window.CMIIsPresent == null) {
  9.       if (findcmiframe != null) {
  10.         var frm = findcmiframe(null);
  11.         if (frm != null) frm.installcmi(win);
  12.         else if (installcmi != null) {
  13.           installcmi(win);
  14.           cmiinit(win);
  15.       } }
  16.       if (win.CMIInitialize != null) win.CMIInitialize();
  17.   } }
  18.   return (win.CMIIsPresent != null);
  19. }
  20. function MM_cmiSendInteractionInfo(date, time, intid, objid, intrtype, correct, student, result, weight, latency) { //v1.22
  21.   var aDt= new Date();
  22.   var curHr=aDt.getHours()+'', curMin=aDt.getMinutes()+'', curSec=aDt.getSeconds()+'';
  23.   var curDay=aDt.getDate()+'', curMonth=aDt.getMonth()+1+'', curYear=aDt.getYear(), dmy;
  24.  
  25.   if (curYear < 1900) curYear += 1900;
  26.   if (curDay.toString().length==1) curDay = '0'+curDay;
  27.   if (curMonth.toString().length==1) curMonth = '0'+curMonth;
  28.   if (curHr.toString().length==1) curHr = '0'+curHr;
  29.   if (curMin.toString().length==1) curMin = '0'+curMin;
  30.   if (curSec.toString().length==1) curSec = '0'+curSec;
  31.   tim=curHr+":"+curMin+":"+curSec;
  32.   dmy=curDay+"/"+curMonth+"/"+curYear;
  33.   if (date=='') date=dmy;
  34.   if (time=='') time=tim;
  35.  
  36.   if (MM_cmiCheckInstall(window)) {
  37.     if (CMIIsPresent()) {
  38.       CMIAddInteraction(date, time, intid, objid, intrtype, correct, student, result, weight, latency);
  39.       return;
  40.   } }
  41. }
  42. function MM_cmiSendObjectiveInfo(theInt, index, objid, score, status) { //v1.22
  43.   if (MM_cmiCheckInstall(window)) {
  44.     if (CMIIsPresent()) {
  45.       if (theInt) {
  46.         objid = eval(theInt+".trackObjectiveId");
  47.         score = eval(theInt+".score");
  48.       }
  49.       CMISetObj(index, objid, score, status, '', '', '', '');
  50.       return;
  51.   } }
  52. }
  53. function MM_cmiSendScore(theInt, theScore) { //v1.22
  54.   if (MM_cmiCheckInstall(window)) {
  55.     if (CMIIsPresent()) {
  56.       if (theInt) theScore = eval(theInt+'.score');
  57.       CMISetScore(theScore);
  58.       return;
  59.   } }
  60. }
  61. function MM_cmiSetLessonStatus(theStatus) { //v1.22
  62.   if (MM_cmiCheckInstall(window)) {
  63.     if (CMIIsPresent()) {
  64.       CMISetStatus(theStatus);
  65.       return;
  66.   } }
  67. }
  68. function MM_cmiSetTime(theInt, theSeconds) { //v1.22
  69.   if (MM_cmiCheckInstall(window)) {
  70.     if (CMIIsPresent()) {
  71.       if (theInt) theSeconds = eval(theInt+'.getTime()');
  72.       CMISetTime(theSeconds);
  73.       return;
  74.   } }
  75. }
  76. function MM_judgeInt(intId) { //v1.0
  77.   eval(intId+".judge()");
  78. }
  79. function MM_resetInt(intId,method,item) { //v1.0
  80.   if (item!=null && item)
  81.     if (method=="resetElems") {method="e['"+item+"'].reset"; item=""}
  82.     else item = "'"+item+"'";
  83.   else item="";
  84.   eval(intId+"."+method+"("+item+")");
  85. }
  86. function MM_setIntProps(jsStr) { //v1.0
  87.   eval(jsStr);
  88. }
  89. function MM_initInteractions() { //v1.0
  90.   if (window.MM_initIntFns) {eval(window.MM_initIntFns); window.MM_initIntFns = '';}
  91. }
  92.